package rudia.org.core;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RudiaDao {

	@Autowired
	private SqlSession dao;

	protected RudiaDao() {
		// PMD abstract Rule
		// - If the class is intended to be used as a base class only (not to be
		// instantiated directly)
		// a protected constructor can be provided prevent direct instantiation
	}

	public Object insert(String queryId) {
		return dao.insert(queryId);
	}

	public Object insert(String queryId, Object param) {
		return dao.insert(queryId, param);
	}

	public Object select(String queryId) {
		return dao.selectList(queryId);
	}

	public Object select(String queryId, Object parameterObject) {
		return dao.selectList(queryId, parameterObject);
	}
	
	public void commit(){
		dao.commit();
	}

}
